
set(LIB_SRC Aiot.c AiotEntity.c)

add_subdirectory(Core)
add_subdirectory(MQTT)
add_subdirectory(Security)

#file(GLOB_RECURSE INTERFACE_SOURCE_FILES Aiot.c AiotEntity.c)
#set(LIB_SRC ${LIB_SRC} ${INTERFACE_SOURCE_FILES} PARENT_SCOPE)

#外部可传入文件
set(LIB_SRC ${INPUT_SRC} ${LIB_SRC})

#外部可传入动态库
set(LIB_SO ${INPUT_SO})

include_directories(${PROJECT_SOURCE_DIR}/Src)

#指定生成库生成路径,这里注意尽量使用CMAKE_LIBRARY_OUTPUT_DIRECTORY，因为LIBRARY_OUTPUT_PATH为旧的变量
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY  ${PROJECT_SOURCE_DIR}/Lib/${Platform})  #动态库
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY  ${PROJECT_SOURCE_DIR}/Lib/${Platform})  #静态库

ADD_LIBRARY (umqtt SHARED ${LIB_SRC})
ADD_LIBRARY (umqtt_static STATIC ${LIB_SRC})

target_link_libraries(umqtt ${LIB_SO})
REDEFINE_FILE_MACRO(umqtt)

SET_TARGET_PROPERTIES (umqtt_static PROPERTIES OUTPUT_NAME "umqtt")